Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Add flag to reserve memory to the virtual machine memory size #2469

Conversation

maximsnezhkov
Copy link
Contributor

@maximsnezhkov maximsnezhkov commented Oct 29, 2023

What this PR does / why we need it:
Add flag to configure memory reservation at VSphereMachineTemplate level.
Which issue(s) this PR fixes:
Fixes #2468

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: maximsnezhkov / name: Maxim Snezhkov (9cec761)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Oct 29, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @maximsnezhkov!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-vsphere 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-vsphere has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign killianmuldoon for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 29, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @maximsnezhkov. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 29, 2023
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 30, 2023
@killianmuldoon
Copy link
Contributor

Thanks for the contribution @maximsnezhkov - it would be great to add this to an e2e test so we can ensure it works as expected. Do we know if there's limitations on which environments or versions of VSphere this is available on?

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 63.50%. Comparing base (a4eef1b) to head (9cec761).
Report is 580 commits behind head on main.

Files Patch % Lines
pkg/services/govmomi/vcenter/clone.go 71.42% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2469      +/-   ##
==========================================
- Coverage   63.63%   63.50%   -0.14%     
==========================================
  Files         122      122              
  Lines        8753     8759       +6     
==========================================
- Hits         5570     5562       -8     
- Misses       2773     2783      +10     
- Partials      410      414       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maximsnezhkov
Copy link
Contributor Author

Thanks for the contribution @maximsnezhkov - it would be great to add this to an e2e test so we can ensure it works as expected. Do we know if there's limitations on which environments or versions of VSphere this is available on?

You're welcome. As I understand it, this functionality has been available for use since at least 2013 (https://frankdenneman.nl/2013/02/21/reserve-all-guest-memory-all-locked/)

@chrischdi
Copy link
Member

/retest

1 similar comment
@chrischdi
Copy link
Member

/retest

NumCPUs: numCPUs,
NumCoresPerSocket: numCoresPerSocket,
MemoryMB: memMiB,
MemoryReservationLockedToMax: memLockedToMax,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MemoryReservationLockedToMax: memLockedToMax,
MemoryReservationLockedToMax: vmCtx.VSphereVM.Spec.MemoryReservationLockedToMax,

We can directly reference that setting.

Comment on lines +170 to +175
var memLockedToMax *bool
if vmCtx.VSphereVM.Spec.MemoryReservationLockedToMax != nil {
memLockedToMax = new(bool)
*memLockedToMax = *vmCtx.VSphereVM.Spec.MemoryReservationLockedToMax
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var memLockedToMax *bool
if vmCtx.VSphereVM.Spec.MemoryReservationLockedToMax != nil {
memLockedToMax = new(bool)
*memLockedToMax = *vmCtx.VSphereVM.Spec.MemoryReservationLockedToMax
}

Should not be required when directly referring below

@sbueringer
Copy link
Member

sbueringer commented Apr 9, 2024

@maximsnezhkov Are you still interested in pursuing this PR? (and do you have time to adress the open comments)

@sbueringer
Copy link
Member

/close

See above

@k8s-ci-robot
Copy link
Contributor

@sbueringer: Closed this PR.

In response to this:

/close

See above

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to pin memory for virtual machine
5 participants